<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理页面</title>
<link href="{webroot}theme/admin/css/iframe.css" rel="stylesheet" type="text/css" />
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/js/base.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/js/jquery.vtip.js"></script>
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}theme/admin/js/admin.js"></script>
<script src="{webroot}lib/dialog/artdialog.js"></script>
<!--[if lt IE 9]>
<script src="{webroot}lib/js/html5.js"></script>
<![endif]-->
<script>
$(function(){
	$(".del").click(function(){
		var id;
		id=$(this).attr("rel");
			top.dialog({
				content:'\u786e\u5b9a\u8981\u5220\u9664\uff1f(\u4e0d\u53ef\u6062\u590d)',
				ok:function(){
					var url,data;
					url='?act=del&id='+id+'';
					$.ajax({
					type:"get",
					cache:false,
					url:url,
					success:function(_)
					{
						if(_.substring(0,1)==0)
						{
							$.fn.tips({type:"error",content:_.substring(1)});
						}
						else
						{
							$.fn.tips({type:"ok",content:"\u5220\u9664\u6210\u529f"});
							$("#log_"+id).fadeOut('slow');
						}
						setTimeout('location.href="?"',1000);
					}
					});
									
					},
				cancel:true 
			}).showModal();
		
		})
		
		$(".delall").click(function(){
		    var arrchk=$("input[name='id']:checked");
			var idarr;
			idarr="";
			$(arrchk).each(function(){
				if(idarr==""){idarr+=this.value}else{idarr+=","+this.value}                   
			}); 
			if(idarr=="")
			{
				$.fn.tips({content:"\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"});
			}
			else
			{
				top.dialog({
				content:'\u786e\u5b9a\u8981\u5220\u9664\uff1f(\u4e0d\u53ef\u6062\u590d)',
				ok:function(){
					var url;
					url='?act=delall&id='+idarr+'';
					$.ajax({
					type:"get",
					cache:false,
					url:url,
					success:function(_)
					{
						if(_.substring(0,1)==0)
						{
							$.fn.tips({type:"error",content:_.substring(1)});
						}
						else
						{
							$.fn.tips({type:"ok",content:"\u5220\u9664\u6210\u529f"});
							var idnum;
							idnum=idarr.split(",")
							for(i=0;i<=idnum.length;i++)
							{
								$("#log_"+idnum[i]).fadeOut('slow');
							}
							setTimeout('location.href="?"',1000);
						}
					}
					});
									
					},
				cancel:true 
			}).showModal();
			}
		})
		
		$(".delno").click(function(){
			top.dialog({
				content:'\u786e\u5b9a\u8981\u5220\u9664\uff1f(\u4e0d\u53ef\u6062\u590d)',
				ok:function(){
					var url,data;
					url='?act=delno';
					$.ajax({
					type:"get",
					cache:false,
					url:url,
					success:function(_)
					{
						if(_.substring(0,1)==0)
						{
							$.fn.tips({type:"error",content:_.substring(1)});
						}
						else
						{
							$.fn.tips({type:"ok",content:"\u5220\u9664\u6210\u529f"});
							setTimeout('location.href="?"',1000);
						}
					}
					});
									
					},
				cancel:true 
			}).showModal();
		
		})
		
		
})
</script>
</head>
<body>

<div class="layout-center">
	<div class="right_subject">当前位置：<a href="?">错误日志</a></div>
    <div class="right_body">
        <div class="nav_menu">
            <ul>
                <li class="dropdown"><a href="javascript:;"><span class="iconfont">&#xe617;</span>批量操作↓</a><dl>
                    <dt><a href="javascript:;" class="delall">批量删除</a></dt>
                    <dt><a href="javascript:" class="delno">清空未读</a></dt>
                </dl></li>
            </ul>
        </div>
        
        <div class="table_title">
        日志列表
        </div>
        <form>
        <table id="tablelist">
            <thead>
                <tr>
                    <th width="20"><input type="checkbox" name="chkall" onClick="checkall(this.form)" title="全选/取消" /></th>
                    <th>日志内容</th>
                    <th width="150">日志日期</th>
                    <th width="80">是否已读</th>
                    <th width="80">管理</th>
                </tr>
            </thead>
            <tbody>
            {dim islist:islist=1}
            {sdcms:rs field="id,content,createdate,isread" table="sd_errlog" where="1=1 [wherekey]" order="id desc" pagesize="20" isadminurl="0"}
            {rs:eof}
            <%islist=0%>
            <tr>
                <td colspan="5">没有资料</td>
            </tr>
            {/rs:eof}
            <tr id="log_{$rs[id]}">
                <td><input name="id" type="checkbox" value="{$rs[id]}" /></td>
                <td class="txt_left"><a href="?act=show&id={$rs[id]}">{sdcms.cutstr(sdcms.nohtml($rs[content]),60,1)}</a></td>
                <td>{$rs[createdate]}</td>
                <td>{if $rs[isread]=1}<span>是</span>{else}否{/if}</td>
                <td><a href="?act=show&id={$rs[id]}" >查看</a>　<a href="javascript:;" class="del" rel="{$rs[id]}">删除</a></td>
            </tr>
            {/sdcms:rs}            
            </tbody>
        </table>
        </form>
        {if islist=1}
        <div class="table_bottom">
            {showpage}
        </div>
        {/if}
    </div>
</div>
</body>
</html>